class Statirs {
    constructor() {
        this.init();
    }
}
$.extend(Statirs.prototype, {
    init: function () {
        this.timer = null;
        this.bigAdsHight = $('.big-ads').height();
        this.bigadsTop = parseInt($('.big-ads').offset().top);
        this.adsHeight = $('.ads').height();
        this.adsTop = parseInt($('.ads').offset().top);
        this.scro = $(window).scrollTop();
        // this.statirsda();
        $(window).on('scroll', this.dalay($.proxy(function () {
            this.statirsda();
            this.exchangeBackgroundColor();
        }, this)))
    },
    statirsda: function () {
        this.scro = $(window).scrollTop();
        if (this.scro >= this.bigadsTop) {
            $('.stairs').css({ visibility: 'visible' });
        }
        else {
            $('.stairs').css({ visibility: 'hidden' });
        }
    },
    exchangeBackgroundColor: function () {
        if (this.scro <= this.adsTop) {
            $('.stair1').css({ backgroundPosition: '-176px 0',color:'#fff' });
            $('.stair2').css({ backgroundPosition: '0 -124px' ,color:'#fe6397'});
        }
        else {
            $('.stair1').css({ backgroundPosition: '0 0',color:'#fe6397' });
            $('.stair2').css({ backgroundPosition: '-176px -124px' ,color:'#fff'});
        }
    },
    dalay: function (cb) {
        this.timer = null;
        if (this.timer !== null) return false;
        this.timer = $.proxy(setInterval(function () {
            cb();
            this.timer = null;
        }, 200), this);
    }
})
export default Statirs;